# Contributor: Kiyoshi Aman <kiyoshi.aman@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libwebp
pkgver=1.1.0
pkgrel=0
pkgdesc="Libraries for working with WebP images"
url="https://developers.google.com/speed/webp"
arch="all"
license="BSD-3-Clause"
makedepends="autoconf automake giflib-dev libjpeg-turbo-dev libpng-dev libtool
	tiff-dev"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc $pkgname-tools"
source="https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-$pkgver.tar.gz"

prepare() {
	default_prepare
	./autogen.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-libwebpmux \
		--enable-libwebpdemux \
		--enable-libwebpdecoder
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	mkdir -p "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 PATENTS README "$pkgdir"/usr/share/doc/$pkgname
}

tools() {
	pkgdesc="The WebP command line tools"
	mkdir -p "$subpkgdir"/usr/
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

sha512sums="c8440059a985587d4876a5e7fc2d07523bc7f582a04ee5dab0ef07df32b9635b907224de2cc15246c831dd5d9215569770196626badccc3171fe2832d7cb4549  libwebp-1.1.0.tar.gz"
